package com.goodwill.androidtest.list_test;

import android.location.Address;

import com.goodwill.androidtest.evaluate.Student;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Province implements Serializable /*Cloneable*/  {
    private static final long serialVersionUID = -7622835197591599128L;

    private String name;
    private String id;
    private ArrayList<City> cityList;

    public Province() {
    }

    public Province(String name) {
        this.name = name;
    }

    public Province(String name, List<City> cityList) {
        this.name = name;
        this.cityList = new ArrayList<>(cityList);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<City> getCityList() {
        return cityList;
    }

    public void setCityList(List<City> cityList) {
        this.cityList = new ArrayList<>(cityList);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Province{" +
                "name='" + name + '\'' +
                ", id='" + id + '\'' +
                ", cityList=" + cityList +
                '}';
    }

    //    @Override
//    public Object clone() {
//        Province province = null;
//        try {
//            province = (Province) super.clone();   //浅复制
//        } catch (CloneNotSupportedException e) {
//            e.printStackTrace();
//        }
//        if (province != null && (cityList != null && cityList.size() > 0)) {
//            for (City city : cityList) {
//
//            }
//            province.cityList = (ArrayList<City>) cityList.clone();   //深度复制
//        }
//        return province;
//    }
}
